home *** CD-ROM | disk | FTP | other *** search
- #include "press.h"
- #include <dos.h>
-
- void Press::exe(int)
- {
- mouseHideCursor();
- hilite(); // Executed object is always hilited.
- mouseShowCursor();
- while(1)
- {
- mouseShowCursor();
- get_event(); // Defined in ADDEVENT.H, ADDEVENT.CPP
- mouseHideCursor();
- if(e.what == MOUSEEVENT) // it was mouse
- {
- if(mouse_in(loc(e.where()))) // mouse click on button
- {
- press();
- ::delay(200);
- release();
- global_i[0] = action_type;
- e.what = KEYEVENT;
- e.key = EVENT_RETURN;
- }
- else // outside
- global_i[0] = 0;
- unhilite();
- global_num = 1;
- return;
- }
- else
- {
- switch(e.key)
- {
- case EVENT_F1: return;
- case EVENT_F10:
- case EVENT_ESC:
- case EVENT_TAB:
- case EVENT_F6:
- case EVENT_ALT_F3:
- case EVENT_ALT_F4:
- case EVENT_ALT_TAB:
- unhilite(); mouseShowCursor();
- global_i[0] = 0; global_num = 1;
- return;
- case EVENT_RETURN:
- press(); delay(200); release();
- mouseShowCursor();
- global_i[0] = action_type;
- global_num = 1;
- return;
- case EVENT_F2:
- default:
- break; // return;
- }
- }
- }
- }